#pragma once
#include <vector>
#include "addon.h"

class CUpdater
{
public:
	CUpdater(void);
	~CUpdater(void);
	bool connectToSite(CString url, long timeout, CWnd *wnd=NULL);
	static const CString GetHomeDirectory() ;
	void GetAddons(std::vector<CAddon> *addons);
	static bool UnZip(char *filename, char *destination);
	static bool getHttpFile(char *url, char *file_name, long timeout, CWnd *wnd=NULL);
private:
	CString curr_dir;
	static size_t WriteToFileCallback(void *buffer, size_t size, size_t nmemb, void *stream);
	static bool CUpdater::CreateCatalog(LPCTSTR file_name);
	bool CheckFolders(void);
	static int DownloadProgressCallback (CWnd *bar, double t,			//dltotal
										 double d,			//dlnow
										 double ultotal,
										 double ulnow);
public:
	
};
